﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http.Results;
using System.Web.Mvc;
using KL.UFrame.Core.Unity;
using KL.UFrame.Data.Business;
using Newtonsoft.Json;

namespace KL.UFrame.Api.Controllers
{
    public class PerformanceController : K9ControllerBase
    {
        private IPerformanceBusiness _business;

        public PerformanceController()
        {
            _business = UnityBootstrapper.Current.GetService<IPerformanceBusiness>();
        }

        public PerformanceController(IPerformanceBusiness business)
        {
            _business = business;
        }

        // GET: Performance
        public async Task<ViewResult> Index()
        {
            var model = await _business.GetAllPerformancesAsync();
            return View(model);
        }

        public async Task<ViewResult> Show(int id)
        {
            var model = await _business.GetAsync(id);
            if (model == null) return NotFound();

            //var jsApiSignature = await GetWechatJsApiSignatureAsync();
            //ViewBag.JsApiSignature = jsApiSignature;
            return View(model);
        }
    }
}